package com.study.manage.domain.enumm;

public enum GatewayType {

    iTunes("iTunes", "苹果"), yingyongbao("yingyongbao", "应用宝"), baidu("baidu", "百度"), _360("_360",
            "360"), xiaomi("xiaomi", "小米"), wandoujia("wandoujia", "豌豆荚"), huawei("huawei",
                    "华为"), lenovo("lenovo", "联想"), android_unknown("android_unknown",
                            "安卓未知"), unknown("unknown", "原始"), woyaoxue("woyaoxue",
                                    "我要学"), H5_gqcj("H5:gqcj", "国庆抽奖");

    public String key;

    public String desc;

    private GatewayType(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return key;
    }

    public static GatewayType findByKey(String key) {
        for (GatewayType ga : GatewayType.values()) {
            if (key.equals(ga.key)) {
                return ga;
            }
        }
        return null;
    }
}
